package com.muki.spider.moudle.recycle;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.muki.spider.Spider;

public class MukiSpiderRecycle implements SpiderRecycle {

	private final Logger log = Logger.getLogger(MukiSpiderRecycle.class);
	private List<Spider> spiders = new ArrayList<Spider>();
	
	@Override
	public void init() {
		log.info("回收插件启动!");
	}

	@Override
	public void destroy() {
		log.info("回收插件销毁!");
	}

	@Override
	public void release(Spider spider) {
		log.info("回收插件回收了一个爬虫:"+spider.getName());
		spiders.add(spider);
	}

	@Override
	public void run(Spider spider) {
		release(spider);
	}

}
